layui.config({
    base: "/static/backend/js/"
}).use(['form', 'layer', 'jquery', 'table'], function () {
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : parent.layer,
        table = layui.table,
        $ = layui.jquery;



    //第一个实例
    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#list'
            ,url:'/backend/recharge/integralList/'
            ,toolbar: '#toolbarDemo'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            , page: true //开启分页
            ,limit : 40
            ,cols: [[
                {field: 'type', title: '类型', sort: true,}
                , {field: 'userid', title: '会员id',}
                , {field: 'nickname', title: '昵称',}
                // , {field: 'gender', title: '性别', sort: true,}
                // , {field: 'head_img', title: '头像', templet: '#titleTpl',}
                // , {field: 'level', title: '等级',}
                , {field: 'num', title: '数量', sort: true,}
                , {field: 'create_time', title: '时间', sort: true,}
            ]]
        });
    });

        //用户搜索
        $('.search_btn').click(function () {

            var nickname= $('.searchVal').val();

            console.log(nickname);

            table.reload('list', {

                 url: '/backend/Recharge/integralList'

                ,where: {nickname:nickname} //设定异步数据接口的额外参数

            });

        })


})